package com.zero.qth.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zero.common.core.utils.DateUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.zero.qth.mapper.DriverBalanceDetailMapper;
import com.zero.qth.domain.DriverBalanceDetail;
import com.zero.qth.service.IDriverBalanceDetailService;

/**
 * 司机余额明细Service业务层处理
 * 
 * @author cai-xu-kun
 * @date 2025-09-17
 */
@Service
@RequiredArgsConstructor
public class DriverBalanceDetailServiceImpl extends ServiceImpl<DriverBalanceDetailMapper, DriverBalanceDetail> implements IDriverBalanceDetailService {

    private final DriverBalanceDetailMapper driverBalanceDetailMapper;

    /**
     * 查询司机余额明细分页
     *
     * @param driverBalanceDetail 司机余额明细
     * @param p 分页数据
     * @return 司机余额明细
     */
    @Override
    public Page<DriverBalanceDetail> selectDriverBalanceDetailListPage(DriverBalanceDetail driverBalanceDetail, Page<DriverBalanceDetail> p) {
        return driverBalanceDetailMapper.selectDriverBalanceDetailListPage(driverBalanceDetail, p);
    }

    /**
     * 查询司机余额明细
     * 
     * @param id 司机余额明细主键
     * @return 司机余额明细
     */
    @Override
    public DriverBalanceDetail selectDriverBalanceDetailById(Long id) {
        return driverBalanceDetailMapper.selectDriverBalanceDetailById(id);
    }

    /**
     * 查询司机余额明细列表
     * 
     * @param driverBalanceDetail 司机余额明细
     * @return 司机余额明细
     */
    @Override
    public List<DriverBalanceDetail> selectDriverBalanceDetailList(DriverBalanceDetail driverBalanceDetail) {
        return driverBalanceDetailMapper.selectDriverBalanceDetailList(driverBalanceDetail);
    }

    /**
     * 新增司机余额明细
     * 
     * @param driverBalanceDetail 司机余额明细
     * @return 结果
     */
    @Override
    public int insertDriverBalanceDetail(DriverBalanceDetail driverBalanceDetail) {
        return driverBalanceDetailMapper.insertDriverBalanceDetail(driverBalanceDetail);
    }

    /**
     * 修改司机余额明细
     * 
     * @param driverBalanceDetail 司机余额明细
     * @return 结果
     */
    @Override
    public int updateDriverBalanceDetail(DriverBalanceDetail driverBalanceDetail) {
        return driverBalanceDetailMapper.updateDriverBalanceDetail(driverBalanceDetail);
    }

    /**
     * 批量删除司机余额明细
     * 
     * @param ids 需要删除的司机余额明细主键
     * @return 结果
     */
    @Override
    public int deleteDriverBalanceDetailByIds(Long[] ids) {
        return driverBalanceDetailMapper.deleteDriverBalanceDetailByIds(ids);
    }

    /**
     * 删除司机余额明细信息
     * 
     * @param id 司机余额明细主键
     * @return 结果
     */
    @Override
    public int deleteDriverBalanceDetailById(Long id) {
        return driverBalanceDetailMapper.deleteDriverBalanceDetailById(id);
    }
}
